﻿using System.Collections.Generic;
using DAL;
using Model;

namespace BLL
{
    public class StudentService
    {
        private readonly StudentRepository _studentRepository;

        public StudentService()
        {
            _studentRepository = new StudentRepository();
        }

        public void AddStudent(Student student)
        {
            _studentRepository.AddStudent(student);
        }

        public void DeleteStudent(int studentId)
        {
            _studentRepository.DeleteStudent(studentId);
        }

        public void UpdateStudent(Student student)
        {
            _studentRepository.UpdateStudent(student);
        }

        public List<Student> GetStudents(string name)
        {
            return _studentRepository.SearchStudentsByName(name);
        }
    }
}
